# Contributor: 6543 <6543@obermui.de>
# Maintainer: 6543 <6543@obermui.de>
pkgname=tea
pkgver=0.8.0
pkgrel=4
pkgdesc="A command line tool to interact with Gitea servers"
url="https://gitea.com/gitea/tea"
license="MIT"
arch="all"
makedepends="go"
options="!check" # no testsuite
subpackages="$pkgname-bash-completion"
source="$pkgname-$pkgver.tar.gz::https://gitea.com/gitea/tea/archive/v$pkgver.tar.gz
	bash_autocomplete
	"

builddir="$srcdir/src/code.gitea.io/$pkgname"

prepare() {
	mkdir -p "${builddir%/*}"
	mv $pkgname "$builddir"
	default_prepare
}

build() {
	export GOPATH="$srcdir"
	export TEA_VERSION="$pkgver"
	unset LDFLAGS
	make build
}

package() {
	install -Dm755 "$builddir"/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 "$srcdir"/bash_autocomplete "$pkgdir"/usr/share/bash-completion/completions/tea
}

sha512sums="
deb67690c92cb2b48612ddf1cf5fb7efed6a6ad516e41956c26981b8abf94854ad6af47daa526242d8632d21b30b07dd681856434b5097c2ce75345ab970da4f  tea-0.8.0.tar.gz
d89c90cde59ec43c0ff3eb9db9928cbb8be765e264eff8dabf2889507a5fe5d4799d89a7b02832c11954d684f232e1265f4aa740c9c5e26954d2ac8f7d4a7a57  bash_autocomplete
"
